<template>
  <div class="table">
    <div class="">
      <pdf v-for="item in numPages" :key="item" :src="signName" :page="item" ref="pdf"></pdf>
      <!--<img src="../../../static/pdf/e2104e17d06e02faa830a74e6478a620.pdf">-->
    </div>

  </div>
</template>
<script>
  import {getAgreement} from '../../api/public/api';

  import pdf from 'vue-pdf'
  export default{
    components: { pdf},
    data(){
      return{
        signName:"",
        numPages:0
      }
    },
    mounted(){
      console.log("this.$route.query.signName",this.$route.query.signName)
      this.signName="http://payment-admin.itentbase.com/pdf/"+this.$route.query.signName
      this.getAgreement()
    },
    methods:{
      getAgreement(){

        // this.signName="../../../static/pdf/e2104e17d06e02faa830a74e6478a620.pdf"
        let loadingTask = pdf.createLoadingTask(this.signName)
        console.log("loadingTask", loadingTask)
        loadingTask.promise.then(pdf => {
          console.log(1,"pdf",pdf)
          this.numPages = pdf.numPages
        })
      }
    }

  }
</script>
